WPS Office.apk(点击下载) / giz.java


package defpackage;

import android.text.TextUtils;
import cn.wps.core.runtime.Platform;
import cn.wps.moffice.OfficeApp;
import cn.wps.moffice_eng.R;
import com.appsflyer.AppsFlyerProperties;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
import com.mopub.mobileads.VastExtensionXmlManager;
import java.util.LinkedHashMap;
import org.json.JSONArray;
import org.json.JSONObject;

/* renamed from: giz  reason: default package */
public final class giz {
    private static String hev = "https://wpsqa.wps.cn/api/qa/hot";

    public static LinkedHashMap<String, String> bPD() {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("count", 20);
            jSONObject.put(AppsFlyerProperties.CHANNEL, OfficeApp.arx().arB());
            jSONObject.put("appVersion", OfficeApp.arx().getString(R.string.app_version));
            jSONObject.put(SpeechConstant.LANGUAGE, Platform.getLanguageCode());
            jSONObject.put("packageName", OfficeApp.arx().getPackageName());
            String c = lwd.c(hev, jSONObject.toString(), null);
            if (TextUtils.isEmpty(c)) {
                return null;
            }
            JSONObject jSONObject2 = new JSONObject(c);
            if (!"ok".equalsIgnoreCase(jSONObject2.optString(SpeechUtility.TAG_RESOURCE_RESULT))) {
                return null;
            }
            String optString = jSONObject2.optString(FirebaseAnalytics.Param.CONTENT);
            if (TextUtils.isEmpty(optString)) {
                return null;
            }
            JSONArray jSONArray = new JSONArray(optString);
            LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>();
            for (int i = 0; i < jSONArray.length(); i++) {
                JSONObject jSONObject3 = jSONArray.getJSONObject(i);
                String optString2 = jSONObject3.optString("question");
                String optString3 = jSONObject3.optString("answer");
                String optString4 = jSONObject3.optString(VastExtensionXmlManager.TYPE);
                if (!TextUtils.isEmpty(optString2) && !TextUtils.isEmpty(optString3) && "url".equals(optString4)) {
                    linkedHashMap.put(optString2, optString3);
                }
            }
            return linkedHashMap;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}